package com.hanhai.zrb.model.project.enums;

/**
 * 项目和资金的状态，使用同一个哦
 * @author leiruiqi@hanhai.com
 *
 */
public enum ProjectStatusEnums {
//	草稿	201
//	已提交	202
//	已发布	203
//	已撤回	204
//	已成交	205
//	已删除	206
	DRAF(201,"草稿"),
	SUBMIT(202,"已提交"),
	RELEASE(203,"已发布"),
	WITHDRAW(204,"已撤回"),
	//INVESTPROJECT(1,"招商中"),
	DEALPROJECT(205,"已成交"),
	DEL(206,"已删除"),
	;
	
	private Integer code;
	
	private String value;
	
	public Integer getCode() {
		return code;
	}

	public String getValue() {
		return value;
	}

	private ProjectStatusEnums(int code,String value){
		this.code = code;
		this.value = value;
	}
	
	public static String  getValueByCode(int code){
		for(ProjectStatusEnums status:ProjectStatusEnums.values()){
			if(status.getCode() == code){
				return status.getValue();
			}
		}
		return null;
	}
	
	public static ProjectStatusEnums getByCode(int code){
		for(ProjectStatusEnums status:ProjectStatusEnums.values()){
			if(status.getCode() == code){
				return status;
			}
		}
		return null;
	}
	
	public static void main(String[] args) {

		for(ProjectStatusEnums status :ProjectStatusEnums.values()){
			System.out.println("code="+status.getCode()+ " values = "+status.getValue());
		}
	}
}
